//
//  HomeMoneyTipsView.m
//  carcareIOS
//
//  Created by ileo on 16/4/6.
//  Copyright © 2016年 chezheng. All rights reserved.
//

#import "HomeMoneyTipsView.h"

@implementation HomeMoneyTipsView


-(instancetype)initWithCenter:(CGPoint)center money:(NSInteger)money{

    self = [super initWithFrame:CGRectMake(0, 0, 10, 10)];
    if (self) {
        UIImage *image = ImageNamed(@"Home_ShowGetMoney");
        self.height = image.size.height;
        UIImageView *imageV = [Factory imageViewWithOriginal:CGPointMake(0, 0) image:image onView:self];
        UILabel *unitL = [Factory flabelWithWidth:100 font:FONT_DEFAULT_Light(12) text:@"挣点" textColor:COLOR_HEXSTRING(@"#fda100") onView:self resetSizeFinish:nil];
        __weak __typeof(self) wself = self;
        [Factory flabelWithWidth:100 font:FONT_DEFAULT_Light(23) text:[NSString stringWithFormat:@"+%zd",money] textColor:COLOR_HEXSTRING(@"#fda100") onView:self resetSizeFinish:^(UILabel *label) {
            label.left = imageV.right + 3;
            label.centerY = wself.centerY - 1;
            unitL.left = label.right + 3;
            unitL.bottom = label.bottom - 3;
            wself.width = unitL.right;
        }];
        self.center = center;
    }
    return self;

}

@end
